<template>
    <view class="page">
        <view class="header_box">
            <view class="header_nav_box">
                <view class="back_left_box" @click="goBack"></view>
                <view class="header_title_box"></view>
            </view>
        </view>
        <view class="swiper_big_box">
            <view class="uni-margin-wrap">
                <swiper class="swiper" circular next-margin="32rpx" previous-margin="160rpx" :indicator-dots="indicatorDots"
                    :autoplay="autoplay" :interval="interval" :duration="duration">
                    <swiper-item v-for="(item, index) in fifterList" :key="index">
                        <view class="swiper-item uni-bg-red"
                            style="background-image: url('https://new.qingfentool.vip/upload/image/20230729/786cd7d2213df76a7b7ed4aab4df1879.png'); background-size: 100% 100%; ">
                            <view class="swiper_bonus_box"></view>
                            <view class="swiper_pic_box">
                                <image :src="item.prize_icon" mode="widthFix" />
                            </view>
                            <view class="jiage_box">兑换价：{{ item.recovery_price }}大王币</view>
                            <view class="swiper_probability_box">
                                概率 <text>{{ item.probability }}%</text>
                            </view>
                        </view>
                    </swiper-item>
                </swiper>
            </view>
        </view>
        <view class="instructions_box">
            获取奖品说明
        </view>
        <!-- #ifdef  MP-WEIXIN-->
        <scroll-view scroll-y class="shuoming_content_box" v-html="shuoming"></scroll-view>
        <!-- #endif -->
        <!-- #ifdef APP-PLUS -->
        <view class="shuoming_content_box1" v-html="shuoming"></view>
        <!-- #endif -->
        <view class="winning_box" @click="winningBtn">
            <view class="winning_small_box">
                <view class="winning_btn_box"></view>
            </view>
        </view>
        <uni-popup mode="center" ref="kaijiangTc" border-radius="20" :mask-click=false>
            <view class="kaixiang_box">
                <view class="top1_box">
                    <image src="https://new.qingfentool.vip/upload/image/20230704/9d71720b0935309f280c7e2562ab2e1a.png"
                        mode="scaleToFill" />
                </view>
                <view class="pic_box">
                    <view class="sm_pic_box">
                        <image :src="obj.prize_icon" mode="scaleToFill" />
                    </view>
                    <view class="sm_name_box">{{ obj.prize_name }}</view>
                    <view class="sm_prc_box">官方价：{{ obj.price }}大王币</view>
                </view>
                <view class="kaijiang_txt">已为您存放至盒柜
                    <text @click="gohegui" style="color:#FF9851;">前往盒柜</text>
                </view>
                <view class="enter_box" @click="guanbi">确定</view>
            </view>
        </uni-popup>
    </view>
</template>
<script>
export default {
    data() {
        return {
            fifterList: [],
            indicatorDots: false,
            autoplay: true,
            interval: 3000,
            duration: 1000,
            id: '',
            shuoming: '',
            obj: {}
        }
    },
    onLoad(e) {
        this.id = e.ID
    },
    onShow() {
        this.getInit()
    },
    methods: {
        goBack() {
            uni.navigateBack()
        },
        // 去盒柜
        gohegui() {
            uni.switchTab({
                url: '/pages/index/cabinetBox'
            })
        },
        winningBtn() {
            let data = {
                id: this.id
            }
            this.$Request.post(this.$api.mall.stairReward, data).then(res => {
                this.$refs.kaijiangTc.open()
                this.obj = res.data.data
                uni.setStorageSync('cabShuaxin', 1)
            })
        },
        guanbi() {
            this.$refs.kaijiangTc.close()
        },
        getInit() {
            let data = {
                id: this.id
            }
            this.$Request.get(this.$api.mall.stairShow, data).then(res => {
                this.fifterList = res.data.prize_list.concat(res.data.prize_list)
                this.shuoming = res.data.reward_info
            })
        }
    }
}
</script>
<style scoped lang="scss">
.page {
    width: 100vw;
    min-height: 100vh;
    background-image: url('https://new.qingfentool.vip/upload/image/20230727/f84b987a3736c95c34eefa93ddf3c93e.png');
    background-size: 100% 100%;

    .header_box {
        width: 100%;
        height: 146rpx;
        padding-top: 86rpx;
        margin-bottom: 78rpx;

        .header_nav_box {
            width: 100%;
            height: 60rpx;
            position: relative;
            bottom: 0;

            .back_left_box {
                width: 18rpx;
                height: 30rpx;
                background-image: url('https://new.qingfentool.vip/upload/image/20230729/28ecddbea3d5c9fb9a72b8a38e83c7ff.png');
                background-size: 100% 100%;
                position: absolute;
                left: 33rpx;
                top: 0;
                bottom: 0;
                margin: auto;
            }

            .header_title_box {
                width: 210rpx;
                height: 41rpx;
                position: absolute;
                background-image: url('https://new.qingfentool.vip/upload/image/20230729/1cbc77b4862faafb4c7143d3aeb8e8a1.png');
                background-size: 100% 100%;
                left: 0;
                right: 0;
                top: 0;
                bottom: 0;
                margin: auto;
            }
        }
    }

    .swiper_big_box {
        width: 100%;
        height: 528rpx;
        margin-bottom: 60rpx;

        .uni-margin-wrap {
            width: 100%;
            height: 100%;

            .swiper {
                width: 100%;
                height: 528rpx;

                .swiper-item {
                    width: 438rpx;
                    display: block;
                    height: 100%;
                    padding-top: 82rpx;

                    .swiper_bonus_box {
                        width: 130rpx;
                        height: 28rpx;
                        margin: auto;
                        background-image: url('https://new.qingfentool.vip/upload/image/20230729/9ed392c82fa8babcbe8cf96dae0019c3.png');
                        background-size: 100% 100%;
                        margin-bottom: 26rpx;
                    }

                    .swiper_pic_box {
                        width: 216rpx;
                        height: 241rpx;
                        // background-color: #fff;
                        margin: auto;
                        // margin-bottom: 16rpx;

                        image {
                            width: 100%;
                        }

                    }

                    .jiage_box {
                        width: 228rpx;
                        height: 36rpx;
                        line-height: 36rpx;
                        font-size: 24rpx;
                        font-weight: 500;
                        color: #333;
                        margin: auto;
                        text-align: center;
                    }

                    .swiper_probability_box {
                        width: 228rpx;
                        height: 62rpx;
                        margin: auto;
                        background-image: url('https://new.qingfentool.vip/upload/image/20230729/ba0102f7a9e02ad8cc0beff1ac0ee4fa.png');
                        background-size: 100% 100%;
                        text-align: center;
                        line-height: 62rpx;
                        font-size: 21rpx;
                        font-weight: 500;
                        color: #FFFFFF;
                        padding-right: 15rpx;

                        text {
                            font-size: 27rpx;
                        }
                    }

                }
            }
        }

    }

    .instructions_box {
        width: 426rpx;
        height: 56rpx;
        background-image: url('https://new.qingfentool.vip/upload/image/20230729/ef6d29bdbbd7c6995839fd8fe2f1269a.png');
        background-size: 100% 100%;
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #342E27;
        text-align: center;
        line-height: 56rpx;
        margin: auto;
        margin-bottom: 46rpx;
    }

    .shuoming_content_box {
        width: 674rpx;
        height: 360rpx;
        color: #fff;
        // background-color: #fff;
        margin: auto;
        margin-bottom: 160rpx;
    }

    .shuoming_content_box1 {
        width: 674rpx;
        height: 360rpx;
        color: #fff;
        overflow: hidden;
        overflow: auto;
        margin: auto;
        margin-bottom: 160rpx;
    }

    .winning_box {
        width: 628rpx;
        height: 98rpx;
        background: linear-gradient(0deg, #E9DFAB 0%, #FDECBF 100%);
        border-radius: 49rpx;
        position: relative;
        margin: auto;

        .winning_small_box {
            position: absolute;
            width: 594rpx;
            height: 73rpx;
            background: linear-gradient(0deg, #EDCF75 0%, #CCA94C 100%);
            border: 1px solid #C9A823;
            border-radius: 37rpx;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;

            .winning_btn_box {
                position: absolute;
                width: 92rpx;
                height: 32rpx;
                left: 0;
                right: 0;
                top: 0;
                bottom: 0;
                margin: auto;
                background-image: url('https://new.qingfentool.vip/upload/image/20230729/f3ccbbf0df9a04abdee9135074606e79.png');
                background-size: 100% 100%;
            }
        }
    }

    /deep/.u-mode-center-box {
        background: none !important;
    }

    .kaixiang_box {
        width: 710rpx;
        height: 1100rpx;
        padding-top: 20rpx;
        border-radius: 50rpx;
        background-image: url('https://new.qingfentool.vip/upload/image/20230727/f84b987a3736c95c34eefa93ddf3c93e.png') !important;
        background-size: 100% 100% !important;


        .top1_box {
            width: 95%;
            height: 106rpx;
            margin: auto;

            image {
                width: 100%;
                height: 100%;
            }
        }

        .pic_box {
            width: 420rpx;
            height: 544rpx;
            border-radius: 28rpx 28rpx 28rpx 28rpx;
            opacity: 1;
            background-color: #26369B;
            margin: 50rpx auto;
            // margin-top: ;
            margin-bottom: 54rpx;
            padding-left: 28rpx;
            padding-top: 28rpx;

            .kaixiang_dengji_box {
                width: 150rpx;
                height: 60rpx;
                margin-bottom: 8rpx;

                image {
                    width: 100%;
                    height: 100%;
                }

            }

            .sm_pic_box {
                width: 314rpx;
                height: 320rpx;
                margin: auto;
                margin-bottom: 10rpx;

                image {
                    width: 100%;
                    height: 100%;
                }
            }

            .sm_name_box {
                width: 264rpx;
                height: 45rpx;
                font-size: 28rpx;
                font-family: Source Han Sans CN-Medium, Source Han Sans CN;
                font-weight: 500;
                color: #FFFFFF;
                line-height: 35rpx;
                margin: auto;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-bottom: 10rpx;
            }

            .sm_prc_box {
                width: 198rpx;
                height: 40rpx;
                font-size: 22rpx;
                font-family: Source Han Sans CN-Medium, Source Han Sans CN;
                font-weight: 500;
                color: #FFFFFF;
                line-height: 33rpx;
                margin: auto;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
        }

        .kaijiang_txt {
            width: 100%;
            height: 20rpx;
            font-size: 36rpx;
            font-family: HappyZcool-2016-Medium, HappyZcool-2016;
            font-weight: 400;
            color: #FFFFFF;
            line-height: 19rpx;
            text-align: center;
            margin-bottom: 100rpx;
        }

        .enter_box {
            width: 316rpx;
            height: 96rpx;
            background: linear-gradient(0deg, #EDCF75 0%, #CCA94C 100%);
            border: 1px solid #C9A823;
            border-radius: 37rpx;
            // opacity: 1;
            text-align: center;
            line-height: 98rpx;
            color: #fff;
            font-size: 40rpx;
            margin: auto;
        }
    }
}
</style>